# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pytest-mypy
pkgver=0.10.3
_commit=62c03db621543896ff6166dddd9e9e4f7c78ad7a
pkgrel=4
pkgdesc='Mypy static type checker plugin for Pytest'
arch=('any')
license=('MIT')
url='https://github.com/dbader/pytest-mypy'
depends=('python-attrs' 'python-filelock' 'python-pytest' 'mypy')
makedepends=('git' 'python-setuptools-scm')
checkdepends=('python-pytest-xdist' 'python-pexpect')
source=("git+https://github.com/dbader/pytest-mypy.git#commit=$_commit")
sha512sums=('SKIP')

build() {
  cd pytest-mypy
  python setup.py build
}

check() {
  # Hack entry points by installing it

  local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
  cd pytest-mypy
  python setup.py install --root="$PWD/tmp_install" --optimize=1
  PYTHONPATH="$PWD/tmp_install$site_packages:$PYTHONPATH" pytest
}

package() {
  cd pytest-mypy
  python setup.py install --root="$pkgdir" --optimize=1
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}

# vim:set ts=2 sw=2 et:
